from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel


class User(BaseModel):
    id: int
    name = 'John Doe'
    signup_ts: Optional[datetime] = None
    friends: List[int] = []


external_data = {
    'id': 123,
    'name': 123456,
    'signup_ts': '2017-06-01 12:22',
    'friends': [1, '2', b'3'],
}
print(external_data)
user = User(**external_data)
print(user)
print('Over')
